#ifndef MODELMAPION_H
#define MODELMAPION_H

#include <QString>
#include <QVariantMap>
#include <QObject>

class Mapion : public QObject{
    Q_OBJECT
public:
    template<class T>
    static T fromVariantMap(const QVariantMap &map);
    template<class T>
    static QList<T> fromVariantMaps(const QList<QVariantMap> &maps);
    static QList<QVariantMap> toVariantMaps(const QList<Mapion> &mapions);
    Mapion(QObject *parent = nullptr);
    // [-] 废弃
    Mapion(const Mapion &mapion);
    Mapion(const QVariantMap &map);
    // [!] 废弃
    virtual ~Mapion(){}

    QVariantMap toMap() const;
    virtual void fromMap(const QVariantMap &map);
    virtual void operator=(const Mapion &obj);
};

#endif // MODELMAPION_H
